/*
 * @Description:
 * @Author: Zzt
 * @Date: 2022-08-18 13:44:33
 * @LastEditTime: 2022-08-18 14:02:51
 */
import { SET_SELECT_AT, SET_SELECT_FOND_ID, SET_SELECT_AT_ID } from '../constants';

export const RestoreReducer = (state, action) => {
  switch (action.type) {
    /**
     * @description: 设置选中的全宗
     */
    case SET_SELECT_FOND_ID:
      return {
        ...state,
        selectFondId: action.id
      };

    /**
     * @description: 设置选中的档案类型
     */
    case SET_SELECT_AT:
      return {
        ...state,
        selectAT: action.data
      };

    /**
     * @description: 设置选中的档案类型
     */
    case SET_SELECT_AT_ID: {
      return {
        ...state,
        selectATId: action.id
      };
    }
    default:
      console.log('untouched', action);
      return state;
  }
};
